list1 = ["apple","banana","tofu"]

def spam(list1):
    string1 = ""
    for i in list1:
        print(i)
        if i == list1[-1]:
            string1 = string1 +", and " + str(i)
            print(string1)
            return string1
        string1 = str(i) + ", " + string1



if __name__  == "__main__":
    spam(list1)